package Widgets104

jlouie 9.96
supplied AS_IS.
free for non_commercial use.

A set of reusable Java classes:

1)  MyTextField.java:

An object oriented TextField that supports tab, shift-tab and
key filters. This version does not trap the return key.
This version declares methods SetNextField, SetPrevField public.

NUMERIC_ONLY accepts .,0 to 9
SIGNED_NUMERIC_ONLY accepts -.,0 to 9
PHONE_ONLY accepts - 0 to 9
CUSTOM_KEY accepts any key in String customKey

constants NO_KEY_FILTER, NUMERIC_ONLY, DIGITS_ONLY, PHONE_ONLY
CUSTOM_KEY, SIGNED_NUMERIC_ONLY.
  
constructor MyTextField(String str, int col)
MyTextField(String str, int col, int keyFilter)
MyTextField(String str, int col, int keyFilter, String customKey)

class method SetTabFields(MyTextField[] arrayFields)
automagically sets tab order when passed an _initialized_
array of MyTextFields.
SetPrevField(MyTextField field) and SetNextField(MyTextField field)
are public methods.

MyTextField[] arrayFields= new MyTextField[2];
arrayFields[0]= new MyTextField("Area Code",3,MyTextField.DIGITS_ONLY);
arrayFields[1]= new MyTextField("W",1,MyTextField.CUSTOM_KEY,"HWFCP");
MyTextField.SetTabFields(arrayFields);

2) MyDialog.java:

This class creates a one, two or three button custom dialog box.
interface DialogInterface.java:
ButtonOne(String label);
ButtonTwo(String label);
ButtonThree(String label);

constants NO_DEFAULT, BUTTON_ONE, BUTTON_TWO, BUTTON_THREE
constructor MyDialog(Frame f) // default DialogBox,Confirm,?,OK,BUTTON_ONE
MyDialog(Frame f, String title);
MyDialog(Frame f, String title, String mess1)
MyDialog(Frame f, String title, String mess1, String mess2)
MyDialog(Frame f, String title, String mess1, String mess2, int defaultButton)
MyDialog(Frame f, String title, String mess1, String mess2, int defaultButton,
	String buttonOne)
MyDialog(Frame f, String title, String mess1, String mess2, int defaultButton,
	String buttonOne, String buttonTwo)
MyDialog(Frame f, String title, String mess1, String mess2, int defaultButton,
	String buttonOne, String buttonTwo, String buttonThree)

MyDialog dl= null;  
void DoAboutBox()
{
	if (dl != null)
	{
		if (dl.isShowing()) dl.hide();
		dl.dispose();
		dl= null;
	}
	dl= new MyDialog(this,"About Box","Widgets v1.03","jlouie 9.96");
}

public void ButtonOne(String label) {;}
public void ButtonTwo(String label) {;}
public void ButtonThree(String label) {;}

3)  Format.java:
Formats a double or Double to a non-exponential string with or without commas.

class methods 
public static String ToString(Double db);
public static String ToString(double d);
public static String ToCommaString(Double db);
public static String ToCommaString(double d);

double d= 999999.5;
String str= Format.ToCommaString(d);
output 1,000,000

Have fun with Java,
Jeff		